package com.css.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.css.Response;
import com.css.base.BaseServiceImpl;
import com.css.entity.BasAssets;
import com.css.mapper.BasAssetsMapper;
import com.css.service.IBasAssetsService;
import com.css.test.autowire.AutowireBeanTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.function.Function;

/**
 * <p>
 * 资产表 服务实现类
 * </p>
 *
 * @author css
 * @since 2020-02-29
 */
@Service
public class BasAssetsServiceImpl extends BaseServiceImpl<BasAssetsMapper, BasAssets> implements IBasAssetsService {
    @Autowired
    private IBasAssetsService assetsService;
//    @Autowired
//    private AutowireBeanTest autowireBeanTest;

    @Override
    public BasAssets getUserAssets() {
        SFunction<BasAssets, Integer> getUserId = BasAssets::getUserId;
        BasAssets basAssets = getOne(new LambdaQueryWrapper<BasAssets>().eq(getUserId, getUserId()));
//        boolean saveOrUpdate = updateBatchById(basAssets);
        return basAssets;
    }

}
